﻿using System.Diagnostics;
using Microsoft.Phone.Controls;
using WPNEXT.ViewModel;
using MemoryLook;
using System;
using System.Windows.Controls;

namespace WPNEXT.Views
{
    public partial class SimpleWallPage : PhoneApplicationPage
    {
        private SimpleViewModel simple;
        public SimpleWallPage()
        {
            InitializeComponent();
            Counter.EnableMemoryCounter = true;
            simple = (SimpleViewModel)this.DataContext;
        }

        ~SimpleWallPage()
        {
            Debug.WriteLine("释放" + this.GetType().ToString());
        }

        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            simple.OnNavigatedTo(this, e);
        }

        protected override void OnNavigatedFrom(System.Windows.Navigation.NavigationEventArgs e)
        {
            simple.OnNavigatedFrom(this, e);
            base.OnNavigatedFrom(e);
        }

        private void Jump_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            this.simple.ResetDataCommand.Execute(null);
            //SimpleWall.GetValue(ScrollViewer.VerticalScrollBarVisibilityProperty);
            //SimpleWall.SetValue(ScrollViewer.VerticalScrollBarVisibilityProperty, ScrollBarVisibility.Auto);
            //this.NavigationService.Navigate(new Uri("/Views/GuidePage.xaml", UriKind.Relative));
        }
    }
}